

  <table width="100%" style="vertical-align:middle;" border="1" cellspacing="0" cellpadding="0" rules="all" id="tbl_itm_oc" class="tableIn">
      <thead>
        <tr>
          <th>Item</th>
          <th>Almac&eacute;n</th>
          <th>Articulo</th>
          <th>Descripcion</th>
          <th>Precio UM</th>
          <th>Cantidad</th>
          <th>UM</th>
          <th>Ctd Final</th>
          <th>Dcto(%)</th>
          <th>Neto</th>
          <th>Nro.Solp.</th>
          <th>Itm.Solp.</th>
          <th>&nbsp;</th>
        </tr>
        </thead>
        <tbody>
         <?php 		 
		 $last = '';
		 if (!$find){
				$itm_cnt = 0;
				$disable= '';
					 for($a=0;$a<11;$a++){
						$itm_cnt = $itm_cnt + 1;
						$oc_posn[] = '';
						$oc_cods[] =  '';
						$oc_noms[] =  '';
						$oc_prun[] =  '';
						$oc_unm[] = '';
						$oc_dcto[] = '';
						$oc_qtpe[] =  '';
						$oc_qtat[] =  '';
						$oc_nets[] =  '';
						$oc_brut[] =  '';
						$oc_almc[] =  '';
						$oc_ctdf[] = '';
						$oc_spid[]= '';
						$oc_spit[] = '';
						//$oc_cent[] =  '';
						$oc_dels[] =  '';
					 }		 		 
		 }
		 else {
		 $itm_cnt = $itm_cnt + 1;
		 }
//		 echo $itm_cnt;
		 for($a=0;$a < $itm_cnt ; $a++){
		 $hide = '';
		 $disable = '';
		 $mult = 1;
		 
			 if ($a == ($itm_cnt-1)){
			 // La Ultima Linea
				$hide = 'display:none';
				$oc_posn[] = '';
				$oc_cods[] =  '';
				$oc_noms[] =  '';
				$oc_prun[] =  '';
				$oc_dcto[] =  '';
				$oc_qtpe[] =  '';
				$oc_qtat[] =  '';
				$oc_ctdf[] = '';
				$oc_nets[] =  '';
				$oc_almc[] =  '';
				$oc_brut[] = '';
				$oc_spid[] = '';
				$oc_spit[] = '';
				$oc_unm[] = '';
				$last = 'trLast';
				$oc_dels[] =  '';
			 }
			 else {
			 	$last = '';
				 if ($oc_qtat[$a]>0){		 
				 $disable = 'disabled';
				 $mult = -1;
				}
			 }
		 ?>         
        <tr style="<?php echo $hide;?>" title="<?php echo $oc_posn[$a];?>" class="<?php echo $last ;?>" onkeypress="introTr_OC(event)">
          <td><a href="#d_oc_his" onclick="verHistOC(this)"><?php echo $oc_posn[$a];?></a></td>
          <td><select class="clsOCAlm <?php echo $disable;?>">
              <?php echo str_replace("value='".$oc_almc[$a]."'","value='".$oc_almc[$a]."' selected='selected'",$combo_alm);   ?>
          </select></td>
          <td>
          <?php if ($oc_posn[$a] == 0 || $hide != '' ) {
		  ?>
          <input type="text" class="clsCodOc <?php echo $disable;?>" value="<?php echo $oc_cods[$a]; ?>" title="<?php echo $oc_cods[$a]; ?>"  <?php echo $disable;?>>
          <?php 
		  }
		  else {
		  ?>
          <span class="clsCodOc <?php echo $disable;?>" title="<?php echo $oc_cods[$a]; ?>" ><?php echo $oc_cods[$a]; ?></span>
          <?php 
		  }
		  ?>
          </td>
          <td><span class="clsTxtOc"><?php echo $oc_noms[$a]; ?></span></td>
          <td class="clsOCPre">
          <input  type="text" class="qt clsCstUni <?php echo $disable;?>" onchange="mr(this);" size="15" value="<?php echo $oc_prun[$a]; ?>" maxlength="10" <?php echo $disable;?> /> </td>
          <td><input  type="text" class="qt clsQtyOc <?php echo $disable;?>" onchange="mr(this); calcUM_OC(this);"  value="<?php echo $oc_qtpe[$a]; ?>" size="10" maxlength="8" <?php echo $disable;?> > </td>
          <td><select name="select" class="clsQtyUM" onchange="calcUM_OC(this)">
            <?php echo str_replace("value='".$oc_unm[$a]."'","value='".$oc_unm[$a]."' selected='selected'",$combo_um);   ?>
          </select></td>
          <td class="clsCtdFin qt"><?php echo $oc_ctdf[$a]; ?></td>
          <td><input class="qt clsDctOc <?php echo $disable;?>" type="text" onchange="mr(this);" value="<?php echo $oc_dcto[$a]; ?>" name="t_oc_dct" id="t_oc_dct" /></td>
          <td class="qt clsBruOc"><?php echo $oc_nets[$a]; ?></td>
          <td class="clsSolpID qt"><?php echo $oc_spid[$a]; ?></td>
          <td class="clsSolpIt qt"><?php echo $oc_spit[$a]; ?></td>
          <td><input type="button" title="Quitar Item" value="X" <?php if ($disable=='') echo 'onclick="delPos_OC(this)"'; ?> /></td>
        </tr>
        <?php 
		}
		?>
        </tbody>
        <tfoot>
        <tr>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td><input name="btn_addnew" type="button" value="Agregar" onclick="addPosOC()" /></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
       </tfoot>
      </table>
